#ifndef _DATASTRUCT_H
#define _DATASTRUCT_H

#include <QString>
#include <QFile>
#include <QTextStream>

#define NOERROR 1
#define UNDERTAKE 0
#define ERROR -1

#define LOCALCONTOLLER 1
#define REMOTEHMI 2

enum class ENUM_WorkModel {Null,Calibration, SeamFinding, SeamFindingStart2End, SeamTracking};
enum class ENUM_WorkType {Auto,Mannual};
enum class ENUM_ButtonName {RobotUDPConnect,
                            TaskNull,
                            Calibration,
                            SeamFinding,
                            SeamFindingStart2End,
                            SeamTracking,
                            CalPos1,
                            CalPos2,
                            CalPos3,
                            CalPos4,
                            CalPos5,
                            CalPos6,
                            CalibrationDo,
                            CalibrationSave,
                            PointRecord,
                            SeamPosCal};

typedef struct Hand2EyesMatrix{
    double  mMatrix[4][4];
    double  x;
    double  y;
    double  z;
    double  a;
    double  b;
    double  c;
}ST_Hand2EyesMatrix;

typedef struct Hand2EyesCalibrationData{
    bool    bUsed;
    double  mRobotMatrix[4][4];
    double  mLaserMatrix[4][4];
    double  Rx;
    double  Ry;
    double  Rz;
    double  Ra;
    double  Rb;
    double  Rc;

    double  Ly;
    double  Lz;

}ST_Hand2EyesCalibrationData;

typedef struct RobotDAQData{
    bool   bConnected;
    bool   bFirstConnected;
    bool   bSend;
    double KRLRobotPos[6];
}ST_RobotDAQData;

typedef struct SeamFindingData{
    int toRobotMove;
    int frRobotSeamScan;
    int sendCycle;
    bool   StartPointDone;
    bool   EndPointDone;

    double StartPos[6];
    double EndPos[6];
}ST_SeamFindingData;

typedef struct LaserSensorData{
    bool   bSend;
    bool   bConnected;
    bool   bFirstConnected;

    bool   bRecord;
    bool   bRecording;

    bool   bValue;
    double x;
    double y;
    double z;
    double a;
    double b;
    double c;

    double Error;
}ST_LaserSensorData;

typedef struct LaserSeamDataByPCS{
    bool   bValue;
    double POSXYZ[3];
    double EULERZYX[3];
}ST_LaserSeamDataByPCS;

typedef struct DataSaveParam{
    QFile *mSaveFile;
    QTextStream *mStreamData;
    bool SaveFlagLast;
    double TimeOrder;
    double TimeOrderLast;
    double TimeOrderNow;
}ST_DataSaveParam;

typedef struct ButtonStatus{
    bool RobotUDPConnect;
    bool TaskNull;
    bool Calibration;
    bool SeamFinding;
    bool SeamFindingStart2End;
    bool SeamTracking;

    bool CalPos1;
    bool CalPos2;
    bool CalPos3;
    bool CalPos4;
    bool CalPos5;
    bool CalPos6;

    bool CalibrationDo;
    bool CalibrationSave;

    bool PointRecord;
    bool SeamPosCal;
}ST_ButtonStatus;

#endif // _DATASTRUCT_H
